package com.school.springbootmybatis.controller;

import com.school.springbootmybatis.StuService.StuService;
import jakarta.annotation.Resource;
import com.school.springbootmybatis.entity.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StuController {
    @Resource
    private StuService stuService;
    @GetMapping("getStu/{tno}")
    public Student findById(@PathVariable int tno){
        return stuService.findById(tno);
    }
    @GetMapping("delStu/{tno}")
    public void delStu(@PathVariable int tno){
         stuService.deleteById(tno);
    }
}
